package com.chapter01exercise.homework07;

/**
 * @Author 小闽
 * @Date 2024/8/17 9:47
 * @PackageName: com.chapter01exercise.homework07
 * @ClassName: Demo
 * @Description: 子类
 * @Version 1.0
 */
public class Demo extends Test {
    String name = "Jack";
    Demo(){
        super();  // (1) Test
        System.out.println("Demo"); // (2) Demo
    }
    Demo(String s){
        super(s);
    }
    public void test(){
        System.out.println(super.name); // (3) Rose (5) john
        System.out.println(this.name); //  (4) Jack (6) jack
    }

    public static void main(String[] args) {
        new Demo().test();
        new Demo("john").test();
    }
}
